/********************************************************
*  Monica Jimenez Anton                                 *
*  Juan Luis Martinez Cesteros                          *
*  Practicas - IGr                                     *
********************************************************/
#ifndef mallaH
#define mallaH
#include "pv.h"
#include "Lista.h"
#include "Objetos3D.cpp"
//---------------------------------------------------------------------------
class VerticeNormal{
    private:
            GLint iv;
            GLint in;

    public:
            VerticeNormal(){};
            VerticeNormal(GLint v,GLint n){iv=v,in=n;};
            GLint getIn(){return in;};
            GLint getIv(){return iv;};
            void setIn(GLint a){in = a;};
            void setIv(GLint a){iv = a;};
};
//---------------------------------------------------------------------------
class Cara{
       private:
            VerticeNormal ** vn;
            GLint nv;

        public:
            Cara(int n){vn = new VerticeNormal*[n];
                        nv = n;
                       };
            ~Cara(){ for(int i=0;i<nv;i++)
                        delete vn[i];
                     delete [] vn;
                   };
            GLint getNv(){return nv;};
            GLint getIn(int j){return vn[j]->getIn();};
            GLint getIv(int j){return vn[j]->getIv();};
            VerticeNormal  ** getVn(){return vn;};
            void setVn(VerticeNormal ** list){vn = list;};
            void setNv(GLint num){nv = num;};
};
//---------------------------------------------------------------------------
class Malla : public Objeto3D{

    protected:
        GLint nV,nN,nC;
        PV ** vertice;
        PV ** normal;
        Cara ** cara;

    public:
        Malla(){};
        ~Malla();
        void draw();
        void setVertice(PV ** v){vertice = v;};
        void setNormal(PV** n){normal = n;};
        void setCara(Cara ** c){cara = c;};

        PV** getVertice(){return vertice;};
        PV ** getNormal(){return normal;};
        Cara ** getCara(){return cara;};

        GLint getNv(){return nV;};
        GLint getNn(){return nN;};
        GLint getNc(){return nC;};
        void setNv(GLint a){nV = a;};
        void setNn(GLint a){nN = a;};
        void setNc(GLint a){nC = a;};



};


#endif
